package com.bishe.demo.modules.tourism.dao;

import com.bishe.demo.modules.tourism.entity.RouteCity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

/**
 * @Description RouteCityDao
 * @Author Lubb
 * @Date 2021/3/29 14:44
 */
@Repository
@Mapper
public interface RouteCityDao {
    @Insert("insert into tourism_route_city(route_id,city_id) values(#{routeId},#{cityId})")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    void addRouteCity(RouteCity routeCity);

    @Delete("delete from tourism_route_city where route_id=#{routeId}")
    void deleteRouteCityByRouteId(Integer routeId);
}
